<%
  badge_color = case service.status
  when "pending"
    "warning"
  when "healthy"
    "success"
  when "unhealthy"
    "error"
  when "updated"
    "info"
  end
%>
<div class="text-right">
  <div aria-label="Badge" class="badge border-0 bg-<%= badge_color %>/10 font-medium capitalize text-<%= badge_color %>">
    <%= service.friendly_status %>
  </div>
  <% if service.web_service? %>
    <div class="text-sm text-gray-500">
      <% if service.last_health_checked_at %>
        Last checked <%= time_ago(service.last_health_checked_at) %>
      <% else %>
        Never checked
      <% end %>
    </div>
  <% elsif service.cron_job? %>
    <div class="text-sm text-gray-500">Runs <%= Cron2English.parse(service.cron_schedule.schedule).join(" ") %></div>
  <% end %>
</div>
